using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DataAccess.Entities;

namespace DataAccess.Mapping
{
	public class OrgBriefMap : EntityTypeConfiguration<OrgBrief>
	{
		public OrgBriefMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.Brief)
				.HasMaxLength(2000);
				
			// Table & Column Mappings
			this.ToTable("OrgBrief");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.Brief).HasColumnName("Brief");

			// Relationships
			this.HasRequired(t => t.Organization)
				.WithOptional(t => t.OrgBrief);
				
		}
	}
}

